<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <style type="text/css">
        th,td{width: 100px; text-align: center;}
    </style>
    <script type="text/javascript" src="../script/jquery-1.7.2.min.js"></script>
    <script type="text/javascript">
        $(function () {
            $("tr:even").css("background-color","red");
            $("tr:odd").css("background-color","blue");
            $("tr").mouseover(function () {
                //$(this)代表当前触发事件的元素
                $(this).css("background-color","yellow");
            });
            $("tr").mouseout(function () {
                $("tr:even").css("background-color","red");
                $("tr:odd").css("background-color","blue");
            });
        });
    </script>
</head>
<body>
<table border="1" cellspacing="0" cellpadding="0">
    <tr>
        <th colspan="5">展示学生信息</th>
    </tr>
    <tr>
        <th>学生编号</th>
        <th>学生姓名</th>
        <th>年龄</th>
        <th>性别</th>
        <th>爱好</th>
    </tr>
    <tr>
        <td>1001</td>
        <td>张三</td>
        <td>23</td>
        <td>男</td>
        <td>上网</td>
    </tr>
    <tr>
        <td>1002</td>
        <td>李四</td>
        <td>24</td>
        <td>女</td>
        <td>上网</td>
    </tr>
    <tr>
        <td>1002</td>
        <td>李四</td>
        <td>24</td>
        <td>女</td>
        <td>上网</td>
    </tr>
    <tr>
        <td>1002</td>
        <td>李四</td>
        <td>24</td>
        <td>女</td>
        <td>上网</td>
    </tr>
    <tr>
        <td>1002</td>
        <td>李四</td>
        <td>24</td>
        <td>女</td>
        <td>上网</td>
    </tr>
    <tr>
        <td>1002</td>
        <td>李四</td>
        <td>24</td>
        <td>女</td>
        <td>上网</td>
    </tr>
    <tr>
        <td>1002</td>
        <td>李四</td>
        <td>24</td>
        <td>女</td>
        <td>上网</td>
    </tr>
    <tr>
        <td>1002</td>
        <td>李四</td>
        <td>24</td>
        <td>女</td>
        <td>上网</td>
    </tr>
    <tr>
        <td>1002</td>
        <td>李四</td>
        <td>24</td>
        <td>女</td>
        <td>上网</td>
    </tr>
    <tr>
        <td>1002</td>
        <td>李四</td>
        <td>24</td>
        <td>女</td>
        <td>上网</td>
    </tr>
    <tr>
        <td>1002</td>
        <td>李四</td>
        <td>24</td>
        <td>女</td>
        <td>上网</td>
    </tr>

</table>
</body>
</html>